trace1 = go.Scatter(
x=years,
y=r1,
mode="lines",
name="stock 1"
)
trace2 = go.Scatter(
x=years,
y=r2,
mode="lines",
name="stock 2"
)
fig = go.Figure()
fig.add_trace(trace1)
fig.add_trace(trace2)
string = "year %{x}<br>$%{y:.2f}"
fig.update_traces(hovertemplate=string)
fig.update_layout(
template="plotly_dark",
xaxis_title="",
yaxis_title="Accumulation",
xaxis_title_font_size=24,
yaxis_title_font_size=24,
font_size=20,
yaxis_type="log",
yaxis_tickformat=",.0f",
yaxis_tickprefix="$",
width=1000,
height=520,
legend=dict(
yanchor="top",
y=0.99,
xanchor="left",
x=0.1
),
yaxis = dict(
tickmode = 'array',
tickvals = [1, 2, 5, 10, 20, 50, 100],
)
)
fig.show()